<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微商管理 － 添加新商品</title>
    <meta name="keywords" content="龙蛙商城">
    <meta name="description" content="龙蛙商城">

    <link rel="shortcut icon" href="/favicon.ico">
    <link href="../../web/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="../../web/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="../../web/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="../../web/css/animate.min.css" rel="stylesheet">
    <link href="../../web/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/web/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
    <link href="/web/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-md-12">
            <div class="ibox">
                <div class="ibox-content">
                    <form id="ajaxExFrom" class="form-horizontal" role="form">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">品牌名称：</label>
                            <div class="col-sm-4">
                                <input type="text" required id="name" name="name" class="form-control"/>
                            </div>
                            <div class="col-sm-4"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">备注 ：</label>
                            <div class="col-sm-4">
                                <input type="text" id="remark" name="remark" class="form-control"/>
                            </div>
                            <div class="col-sm-4"></div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-5"></div>
                            <button type="button" id="submitCreate" class="btn btn-primary col-sm-1">保存</button>
                            <div class="col-sm-5"></div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../../web/js/jquery.min.js?v=2.1.4"></script>
<script src="../../web/js/bootstrap.min.js?v=3.3.6"></script>
<script src="../../web/js/content.min.js?v=1.0.0"></script>
<script src="../../web/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="/web/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/web/js/plugins/validate/messages_zh.min.js"></script>
<script src="/web/js/plugins/toastr/toastr.min.js"></script>
<script src="/web/js/plugins/fancybox/jquery.fancybox.js"></script>
<script src="/web/js/self/commons.js"></script>
<script type="text/javascript">
    $("#submitCreate").click(function () {
        if (!$("input[id=name]").val()){
            toastr.warning("请填写品牌名称", "警告");
            return false;
        }
        $.ajax({
            url: "/api/admin/goodsSpecifications",
            type: "POST",
            data: {name: $("input[id=name]").val(),remark:$("input[id=remark]").val()},
            dataType: "json",
            async: false,
            success: function (data, textStatus, jqXHR) {
                toastr.success(data.msg, data.title);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                toastr.error(errorThrown, textStatus);
            }
        });
    });
</script>
</body>
</html>
